﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Caching;
using System.Collections;
using System.Web;
using System.IO;
using System.Net;
using System.Configuration;

namespace Jy123.Common
{
    public class HTMLCache
    {
        Cache cache = System.Web.HttpContext.Current.Cache;
        Hashtable ht = new Hashtable();
        Hashtable htPage = new Hashtable();
        bool ioHtml = new bool();
        public HTMLCache()
        {
            IoHtml = true;
            #region 用户及交友部分

            ht.Add("user_login", "User/login.html");                   //登陆页
            ht.Add("user_getpsw","User/GetPsw.htm");//取回密码

            /*主页面************************************************************************************************/            
            ht.Add("user_header", "User/Main/header.htm");                  //用户部分头部
            ht.Add("user_header2","User/Main/Header2.htm");                                 //用户头部2
            ht.Add("user_footer", "User/Main/footer.htm");                  //用户底部
            ht.Add("user_LeftUserCmd", "User/Main/Navigation.htm");       //左侧用户菜单
            ht.Add("user_navigation", "User/Main/Navigation.htm");           //左侧导航
            ht.Add("user_navigation_up", "User/Main/Navigation_Up.htm");           //左侧导航_个人
            ht.Add("user_navigation_down", "User/Main/Navigation_Down.htm");    //左侧导航_组件
            //ht.Add("user_userhot","User/UserHot.htm");                  //人气玩家   
            

            /*个人空间************************************************************************************************/
            ht.Add("user_index", "User/Space/index.html");       //用户首頁
            ht.Add("user_index_usermsg", "User/Space/UserMsg.htm");      //用户首頁消息栏
            ht.Add("user_index_usermsg_other", "User/Space/UserMsg_other.htm");      //别人首頁消息栏
            ht.Add("user_index_userinfo","User/Space/UserInfo.htm");     //用户信息栏
            ht.Add("user_index_userinfo_other", "User/Space/UserInfo_others.htm");     //别人信息栏
            ht.Add("user_face","User/Space/Face.htm");  //表情列表

            ht.Add("user_VisitIn_ul", "User/Space/VisitIn_ul.htm");        //来访者列表ul
            ht.Add("user_VisitIn", "User/Space/VisitIn_li.htm");             //来访者列表li
            ht.Add("user_MyFriendList_ul", "User/Space/MyFriendList_ul.htm"); //我的好友列表UL
            ht.Add("user_HeFriendList_ul", "User/Friend/HeFriendList_ul.htm"); //他的好友列表UL
            ht.Add("user_SheFriendList_ul", "User/Friend/SheFriendList.htm"); //她的好友列表UL

            ht.Add("user_friendlist", "User/Space/MyFriendList_li.htm"); //当前用户的好友列表
            ht.Add("user_congnition", "User/Space/Congnition.htm");  //可能认识的人

            ht.Add("user_minicontent","User/Space/MiniContent.htm");  //迷你内容小标签
            //当前用户主页的小标签
            ht.Add("user_minicontent_ul","User/Space/MiniContent_ul.htm");  //迷你相册内容小标签ul
            ht.Add("user_minicontent_ul_bloglist", "User/Space/MiniContent_ul_BlogList.htm");   //日志列表a
            ht.Add("user_minicontent_ul_blog","User/MiniContent/MiniContent_Blog.htm");   //mini日志列表
            ht.Add("user_minicontent_ul_albumlist", "User/MiniContent/ul_AlbumList.htm");   //相册列表
            ht.Add("user_minicontent_ul_albumlist_a", "User/MiniContent/ul_AlbumList_a.htm");   //相册列表中的4张相册列表a
            ht.Add("user_minicontent_ul_gift","User/MiniContent/MiniContent_Gift.htm"); //mini礼物列表
            ht.Add("user_minicontent_ul_gift_a","User/MiniContent/ul_GiftList_a.htm");  //礼物列表a
            ht.Add("user_minicontent_gift_ul","User/MiniContent/MiniContent_Gift_ul.htm");  //mini礼物列表ul
            ht.Add("user_minicontent_ul_vote","User/MiniContent/MiniContent_Vote.htm");  //Mini投票ul
            ht.Add("user_content_group", "User/MiniContent/MiniContentGroup.htm");   //圈子帖子列表
            ht.Add("user_minicontent_ul_state","User/MiniContent/MiniContent_State.htm");//所有动态
            ht.Add("user_minicontent_ul_state_li","User/MiniContent/ul_StateLi.htm");//所有动态LI
            ht.Add("user_minicontent_ul_guess","User/MiniContent/MiniContent_Guess.htm");//竞猜ul
            //他人主页的小标签
            ht.Add("user_minicontent_ul_albumlist_their","User/MiniContent/MiniContent_Album_Their.htm");//别人的mini相册列表
            ht.Add("user_minicontent_ul_albumlist_their_a", "User/MiniContent/ul_PhotoList_a.htm");//别人的mini相册列表中的4张相片
            ht.Add("user_minicontent_ul_blog_other","User/MiniContent/MiniContent_Blog_others.htm");//别人的mini日志列表
            ht.Add("user_minicontent_ul_gift_other","User/MiniContent/MiniContent_Gift_others.htm");//别人的mini礼物
            ht.Add("user_minicontent_ul_vote_other", "User/MiniContent/MiniContent_Vote_others.htm");//别人的mini投票列表

            /*个人资料************************************************************************************************/
            ht.Add("user_basicinfo", "User/personal/BasicInfo.htm");//个人基本信息
            ht.Add("user_constellation_option","User/personal/ConstellationOption.htm");//星座选项
            ht.Add("user_vocationoption","/User/personal/VocationOption.htm");//行业选项
            ht.Add("user_pravacylike","/User/personal/PrivacyLike.htm");//个人爱好
            ht.Add("user_workInfo", "/User/personal/WorkInfo.htm");//工作信息
            ht.Add("user_uploadportrait","User/personal/UpLoadPortrait.htm");//上传头像
            ht.Add("user_cutimg","User/personal/CutImg.htm");//切割照片
            ht.Add("user_accountmanage","User/personal/AccountManage.htm");//账户管理
            ht.Add("user_altercityin","User/personal/AlterCityIn.htm"); //修改所在地
            ht.Add("user_privacyset","User/personal/PrivacySet.htm");   //隐私设置
            ht.Add("user_privacyselectoption","User/personal/PrivacySelectOption.htm"); //隐私选择下拉项
            
            /*好友************************************************************************************************/
            ht.Add("user_friendadd", "User/Friend/LeftFriendAdd.htm");   //左侧添加好友
            ht.Add("user_friendconfirm","User/Friend/FriendRequestConfirm.htm");   //确认好友请求
            ht.Add("user_friendrequestlist","User/Friend/RequestList.htm");   //好友请求列表
            ht.Add("user_friendrequestok", "User/Friend/Requestok.htm");   //好友请求成功
            ht.Add("user_friendrequestcancel", "User/Friend/Requestcancel.htm");   //好友请求取消
            ht.Add("user_friendlist_main", "User/Friend/FriendList.htm");   //好友列表
            ht.Add("user_friendlist_main_ul","User/Friend/FriendList_ul.htm");  //好友列表ul
            ht.Add("user_friendclass_select_option","User/Friend/FriendClassOption.htm");//好友分类下拉表
            ht.Add("user_friendlist_fgroup_li", "User/Friend/FGroup.htm");//好友分类列表li
            ht.Add("user_friendlist_group_by_Area","User/Friend/FriendGroupByArea.htm");//根据省份查找，好友分类列表
            ht.Add("user_friendclasslist","User/Friend/FriendClassList.htm");//好友分组管理页
            ht.Add("user_friendclasslist_li","User/Friend/FriendClassList_li.htm");//好友分组管理li
            ht.Add("user_friend_tonewclass","User/Friend/AlterFriendtoNewClass.htm");//移动好友到新的分组弹窗
            ht.Add("user_friendvisited","User/Friend/Visited.htm");//访问者列表
            ht.Add("user_friendvisited_ul", "User/Friend/Visited_ul.htm");//访问者列表
            ht.Add("user_friendinvite","User/Friend/Invite.htm");//邀请注册
            ht.Add("user_friendrandom","User/Friend/FriendRandom.htm");//好友随便看看
            ht.Add("user_friendsearch","User/Friend/FriendSearch.htm");//搜索好友

            /*心情************************************************************************************************/
            ht.Add("user_moodmain","User/Mood/Main.htm");//心情日记主页面
            ht.Add("user_moodlist","User/Mood/MoodList.htm");//心情列表
            ht.Add("user_moodcomment","User/Mood/MoodComment.htm");//心情评论列表

            /*日志************************************************************************************************/
            ht.Add("user_blog", "User/Blog/AddBlog.htm");                  //添加日志页
            ht.Add("user_bloglist_my", "User/Blog/BlogList_My.htm");         //我的日志列表
            ht.Add("user_bloglist_my_ul", "User/Blog/BlogList_My_ul.htm");  //我的日志列表ul
            ht.Add("user_bloglist_Friend", "User/Blog/BlogList_Friend.htm");         //好友的日志列表
            ht.Add("user_BlogList_Friend_div", "User/Blog/BlogList_Friend_div.htm");  //好友的日志列表div
            ht.Add("user_blogdetail","User/Blog/BlogDetail.htm");            //查看日志详细
            ht.Add("user_blogdetail_Comment_li","User/Blog/BlogDetail_Comment_li.htm");//日志评论列表LI

            /*相册************************************************************************************************/
            ht.Add("user_album", "User/Album/Album.htm");         //好友相册页
            ht.Add("user_albummy", "User/Album/AlbumMy.htm");         //我的相册
            ht.Add("user_albumall", "User/Album/AlbumAll.htm");           //相册随便看看
            ht.Add("user_albumlistli", "User/Album/AlbumListli.htm");         //相册列表li
            ht.Add("user_albumfriendlistli", "User/Album/AlbumListli_Friend.htm");     //好友的相册列表li
            ht.Add("user_albumlistliImglist", "User/Album/AlbumListliImglist.htm");   //相册列表中的照片li
            ht.Add("user_albumlistliImglist_Friend", "User/Album/AlbumListliImglist_Friend.htm");   //好友的相册列表中的照片li
            ht.Add("user_albumedit", "User/Album/AlbumEdit.htm");  //编辑相册
            ht.Add("user_albumselect", "User/Album/AlbumSelectOption.htm");    //相册下拉列表


            /*照片************************************************************************************************/
            ht.Add("user_photomy", "User/Album/PhotoMy.htm");   //我的照片
            ht.Add("user_photoFriend", "User/Album/PhotoFriend.htm");    //好友的照片
            ht.Add("user_photomy_table", "User/Album/PhotoMy_table.htm");     //照片列表
            ht.Add("user_photoFriend_table", "User/Album/PhotoFriend_table.htm");     //好友的照片列表
            ht.Add("user_photomy_comment_li", "User/Album/PhotoMy_Comment_li.htm");//照片评论列表
            ht.Add("user_photocomment", "User/Album/PhotoComment.htm");        //我的照片评论
            ht.Add("user_photoFriendcomment", "User/Album/PhotoFriendComment.htm");        //我的好友照片评论
            ht.Add("user_photoedit", "User/Album/PhotoEdit.htm");  //编辑照片
            ht.Add("user_photouplist_li", "User/Album/PhotoUplist_li.htm");    //编辑照片列表li
            ht.Add("user_photoadd", "User/Album/PhotoAdd.htm");           //添加照片
            ht.Add("user_photoupload", "User/Album/PhotoUpload.htm");          //用户上传照片
            //ht.Add("user_photoeditportrait","User/Album/PhotoEditPortrait.htm");//设置头像列表
            //ht.Add("user_photoeditportrait_li","User/Album/PhotoEditPortrait_li.htm");//设置头像列表LI

            /*礼物************************************************************************************************/
            ht.Add("user_gift", "User/Gift/Gift.htm");  //礼物主页
            ht.Add("user_giftphoto_li", "User/Gift/Gift_Photo_li.htm");   //礼物图片列表li
            ht.Add("user_giftsend", "User/Gift/GiftSend.htm");            //已送出的礼物列表
            ht.Add("user_giftsend_li", "User/Gift/GiftSend_li.htm");      //送出的礼物列表li
            ht.Add("user_giftreceive", "User/Gift/GiftReceive.htm");            //收到的礼物列表
            ht.Add("user_giftreceive_li", "User/Gift/GiftReceive_li.htm");      //收到的礼物列表li
            ht.Add("user_gift_friendselectoption", "User/Gift/FriendSelectOption.htm");//好友下拉列表
            ht.Add("user_giftclass_a","User/Gift/GiftClass.htm");    //礼物分类li_a


            /*投票************************************************************************************************/
            ht.Add("user_voteadd", "User/Vote/VoteAdd.htm");//发起投票页
            ht.Add("user_votejoin", "User/Vote/VoteJoin.htm");//参加投票页
            ht.Add("user_votejoin_option", "User/Vote/VoteJoinOption_ul.htm");//参加投票中的投票选项
            ht.Add("user_voteduserlist","User/Vote/VotedUserList.htm"); //已投票的用户列表
            ht.Add("user_votecomment_row","User/Vote/VoteComment_Row.htm");//用户评论
            ht.Add("user_votelist", "User/Vote/VoteList.htm");//最新投票列表
            ht.Add("user_votelist_li","User/Vote/VoteList_li.htm");//投票列表li
            ht.Add("user_votelist_option","User/Vote/VoteList_li_Option.htm");//投票的选项列表

            /*竞猜************************************************************************************************/
            ht.Add("guess_index", "Guess/Index.htm");                           //竞猜首页
            ht.Add("guess_js", "Guess/GuessJS.htm");                            //竞猜JS
            ht.Add("guess_indexmain", "Guess/GuessIndexMain.htm");              //竞猜主页面        
            ht.Add("guess_list", "Guess/GuessList.htm");                        //竞猜列表
            ht.Add("guess_listli", "Guess/GuessListLi.htm");                    //竞猜列表li
            ht.Add("guess_menu", "Guess/GuessMenu.htm");                        //竞猜菜单
            ht.Add("guess_add", "Guess/GuessAdd.htm");                          //竞猜添加页
            ht.Add("guess_addjs", "Guess/GuessAddJS.htm");                      //竞猜添加页JS
            ht.Add("guess_indexbutton", "Guess/GuessIndexButton.htm");          //竞猜首页按钮li
            ht.Add("guess_typelist", "Guess/GuessTypeList.htm");                //竞猜类型列表
            ht.Add("guess_typeul","Guess/GuessTypeUl.htm");                     //竞猜类型ul
            ht.Add("guess_logo","Guess/GuessLogo.htm");                         //竞猜LOGO
            ht.Add("guess_info", "Guess/GuessInfo.htm");                        //竞猜信息页
            ht.Add("guess_infojs", "Guess/GuessInfoJS.htm");                    //竞猜信息页JS
            ht.Add("guess_infobuttonli", "Guess/GuessInfoButtonLi.htm");        //竞猜信息按钮li
            ht.Add("guess_infodelbuttonli", "Guess/GuessInfoDelButtonLi.htm");  //竞猜信息删除按钮li
            ht.Add("guess_itemli", "Guess/GuessItemLi.htm");                    //竞猜项
            ht.Add("guess_rightgif", "Guess/GuessRightGif.htm");                //竞猜正确项GIF
            ht.Add("guess_itemradio", "Guess/GuessItemRadio.htm");              //竞猜项Redio
            ht.Add("guess_review", "Guess/GuessReview.htm");                    //竞猜回复
            ht.Add("guess_reviewlistli","Guess/GuessReviewListLi.htm");         //竞猜回复列表li  
            ht.Add("guess_reviewdelimg", "Guess/ReviewDelImg.htm");             //用户竞猜回复删除IMG 
            ht.Add("guess_userstatli", "Guess/UserStatLi.htm");                 //用户竞猜统计li
            ht.Add("guess_dynamicli", "Guess/GuessDynamicLi.htm");              //竞猜动态li
            ht.Add("guess_userdynamicli", "Guess/UserGuessDynamicLi.htm");      //用户竞猜动态li
            ht.Add("guess_toplist", "Guess/GuessTopList.htm");                  //竞猜排行榜
            ht.Add("guess_toplistli", "Guess/GuessTopListLi.htm");              //竞猜排行li
            ht.Add("guess_ie", "Guess/IE.htm");                                 //竞猜排行IE版本格式
           
            /*站内信************************************************************************************************/
            ht.Add("user_letter_main","User/Letter/Main.htm");//收信箱
            ht.Add("user_letterlist","User/Letter/LetterList.htm");//收信箱消息列表
            ht.Add("user_lettercommentlistli","User/Letter/CommentListli.htm");//站内信评论列表（回复列表）
            ht.Add("user_letter_add","User/Letter/Add.htm");//写信
            ht.Add("user_letter_contentdetail","User/Letter/ContentDetail.htm");//站内信内容详细页
            ht.Add("user_letter_notice","User/Letter/Notice.htm");//通知
            ht.Add("user_letter_noticelist","User/Letter/NoticeList.htm");//通知列表
            ht.Add("user_letter_letterCount","User/Letter/LetterCount.htm");//站内信统计

            #endregion
            //-----------------------------------------------------------------
            ht.Add("left", "left.html");                  //首頁
            ht.Add("leftlist", "left_list.html");         //首頁
            ht.Add("xmldemo", "XML/demo.xml");              //XML
            ht.Add("xmldemoitem", "XML/demo_item.xml");    //XML
            ht.Add("header", "Module/header.htm");                 //头部
            ht.Add("footer", "Module/footer.htm");                 //底部
            ht.Add("mainmenu", "Module/MainMenu/mainmenu.htm");             //主按钮
            ht.Add("mainmenusubdiv", "Module/MainMenu/mainmenu_subdiv.htm");//主按钮
            ht.Add("mainmenusubdivli", "Module/MainMenu/mainmenu_subdiv_li.htm");//主按钮
            ht.Add("leftmenu", "Module/LeftMenu/leftmenu.htm");    //左侧菜单
            ht.Add("leftmenuli", "Module/LeftMenu/leftmenu_li.htm");    //左侧菜单
            ht.Add("contentclub", "Module/FootBall/contentclub.htm");   //足球场状态
            ht.Add("clublist", "Module/FootBall/clublist.htm");//好友俱乐部列表（用于赛场）
            ht.Add("myvenues", "Module/FootBallVenues/MyVenues.htm");   //我的赛场主页面            
            ht.Add("updatevenues", "Module/FootBallVenues/UpdateVenues.htm");//升级赛场
            ht.Add("updatevenuesli", "Module/FootBallVenues/UpdateVenues_Li.htm");//升级赛场
            ht.Add("venuesmodel", "Module/FootBallVenues/VenuesModel.htm");//升级赛场
            ht.Add("venuesmodelli", "Module/FootBallVenues/VenuesModel_Li.htm");//升级赛场
            ht.Add("updatevenuesresult", "Module/FootBallVenues/UpdateVenues_Result.htm");//升级赛场
            ht.Add("annexedetail", "Module/FootBallVenues/AnnexeDetail.htm");//赛场设备道具
            ht.Add("annexelist", "Module/FootBallVenues/AnnexeList.htm");//赛场设备道具
            ht.Add("annexeli", "Module/FootBallVenues/Annexe_Li.htm");//赛场设备道具
            ht.Add("modulerank", "Module/FootBallVenues/ModuleRank.htm");//组件排行
            ht.Add("moduleranklist", "Module/FootBallVenues/ModuleRank_List.htm");//组件排行
            ht.Add("modulerankul", "Module/FootBallVenues/ModuleRank_Ul.htm");//组件排行
            ht.Add("venueshire", "Module/FootBallVenues/VenuesHire.htm");//组件租用
            ht.Add("venueshireli", "Module/FootBallVenues/VenuesHire_Li.htm");//组件租用
            ht.Add("venueshirediv", "Module/FootBallVenues/VenuesHire_Div.htm");//组件租用
            ht.Add("venuesrepair", "Module/FootBallVenues/VenuesRepair.htm");//组件维护
            ht.Add("venuesrepairli", "Module/FootBallVenues/VenuesRepair_Li.htm");//组件维护
            ht.Add("venuesrepairform", "Module/FootBallVenues/VenuesRepairForm.htm");//组件维护
            ht.Add("venuesrace", "Module/FootBallVenues/VenuesRace.htm");//比赛
            ht.Add("venuesracebigdiv", "Module/FootBallVenues/VenuesRace_BigDiv.htm");//比赛
            ht.Add("venuesraceclubdiv", "Module/FootBallVenues/VenuesRace_ClubDiv.htm");//比赛
            ht.Add("venuesraceinfodiv", "Module/FootBallVenues/VenuesRace_Info.htm");//比赛
            ht.Add("venuesracepropsdiv", "Module/FootBallVenues/VenuesRace_Props.htm");//比赛
            ht.Add("venuesraceclubli", "Module/FootBallVenues/Venues_ClubLi.htm");//比赛
            ht.Add("venuesraceinfoul", "Module/FootBallVenues/Venues_InfoUl.htm");//比赛
            ht.Add("venuesracepropsli", "Module/FootBallVenues/Venues_PropsLi.htm");//比赛
            //--------------------------------------------------------------------------
            ht.Add("myclub", "Module/Club/MyClub.htm");//我的俱乐部
            ht.Add("mycarclub", "Module/Club/MyCarClub.htm");//我的赛车俱乐部
            ht.Add("myclubsul", "Module/Club/MyClub_SUl.htm");//我的俱乐部
            ht.Add("myclubvul", "Module/Club/MyClub_VUl.htm");//我的俱乐部
            ht.Add("mycluboption", "Module/Club/MyClub_Option.htm");//我的俱乐部
            ht.Add("clubmodulerank", "Module/Club/Club_ModuleRank.htm");//俱乐部排行
            ht.Add("clubhire", "Module/Club/ClubHire.htm");//俱乐部商业活动
            ht.Add("clubprops", "Module/Club/ClubProps.htm");//俱乐部道具
            ht.Add("clubinfo", "Module/Club/ClubInfo.htm");//俱乐部信息
            ht.Add("clubwear", "Module/Club/Club_Wear.htm");//俱乐部信息
            ht.Add("clubsetinfo", "Module/Club/Club_SetInfo.htm");//俱乐部信息
            ht.Add("clubsetinfoli", "Module/Club/Club_SetInfo_Li.htm");//俱乐部信息
            ht.Add("clubsetinfodiv", "Module/Club/Club_SetInfo_Div.htm");//俱乐部信息
            ht.Add("clubstar", "Module/Club/Club_Star.htm");//俱乐部信息
            ht.Add("clubsportsman", "Module/Club/Club_SportsMan.htm");//俱乐部信息
            ht.Add("clubsportsmanul", "Module/Club/Club_SportsManUl.htm");//俱乐部信息
            ht.Add("clubcoche", "Module/Club/Club_Coche.htm");//俱乐部信息
            ht.Add("clubbuystar", "Module/Club/Club_BuyStar.htm");//俱乐部信息
            ht.Add("clubbuycoche", "Module/Club/Club_BuyCoche.htm");//俱乐部信息
            ht.Add("clubstarli", "Module/Club/Club_StarLi.htm");//俱乐部信息
            ht.Add("createmodule", "Module/Club/CreateModule.htm");//创建组件
            ht.Add("createmoduleli", "Module/Club/CreateModule_Li.htm");//创建组件
            ht.Add("selectmodule", "Module/Club/SelectModule.htm");//选择组件
            ht.Add("selectmoduleli", "Module/Club/SelectModule_Li.htm");//选择组件
            //--------------------------------------------------------------------------
            ht.Add("flashobject", "Module/Flash/FlashObject.htm");//Flash Html
            ht.Add("flash", "Module/Flash/Flash.htm");//Flash Html
            ht.Add("xmlvenues", "XML/ModuleFlash/Venues.xml");//Flash Xml
            ht.Add("xmlvenuesrace", "XML/ModuleFlash/VenuesRace.xml");//Flash Xml
            ht.Add("xmlvenuesracepart", "XML/ModuleFlash/VenuesRace_Part.xml");//Flash Xml
            ht.Add("xmlvenuesop", "XML/ModuleFlash/Venues_Op.xml");//Flash Xml
            ht.Add("xmlvenuespart", "XML/ModuleFlash/Venues_Part.xml");//Flash Xml
            ht.Add("xmlvenuesad1", "XML/ModuleFlash/AD1.xml");//Flash Xml
            ht.Add("xmlvenuesad2", "XML/ModuleFlash/AD2.xml");//Flash Xml
            ht.Add("xmlvenuesad3", "XML/ModuleFlash/AD3.xml");//Flash Xml
            ht.Add("xmlvenuesscreen", "XML/ModuleFlash/Screen.xml");//Flash Xml
            ht.Add("xmltest", "Module/Flash/test.xml");//Flash Xml
            ht.Add("readyforbattle", "XML/ModuleFlash/ReadyForBattle.xml");//Flash Xml
            //-----------------------------------------------------------------赛车赛场
            ht.Add("trackinfo", "Module/CarVenues/TrackInfo.htm");//赛道
            ht.Add("trackinfo_detail", "Module/CarVenues/Track.htm");//赛道
            ht.Add("carrace", "Module/CarVenues/CarRace.htm");//赛车比赛
            ht.Add("carraceli", "Module/CarVenues/CarRace_Li.htm");//赛车比赛
            //-----------------------------------------------------------------赛车俱乐部
            ht.Add("carclubcars", "Module/CarClub/ClubCars.htm");//赛车
            ht.Add("carclubstar", "Module/CarClub/ClubStar.htm");//赛车手
            ht.Add("carclubprops", "Module/CarClub/ClubProps.htm");//赛车手
            //-----------------------------------------------------------------比赛结果
            ht.Add("raceresult", "Module/RaceResult.htm");//比赛结果
            ht.Add("raceresultul", "Module/RaceResult_Ul.htm");//比赛结果
            //----------------------------------------------------------------
            ht.Add("mytcenter", "Module/TCenter/MyTCenter.htm");   //我的训练中心主页面 
            ht.Add("tcenterrank", "Module/TCenter/TCenterRank.htm");   //训练中心排行 
            ht.Add("traininfo", "Module/TCenter/TrainInfo.htm");//比赛
            ht.Add("traininfobigdiv", "Module/TCenter/Train_BigDiv.htm");//比赛
            ht.Add("traininfoclubdiv", "Module/TCenter/Train_ClubDiv.htm");//比赛
            CacheAll();
        }
        /// <summary>
        /// 带参创建缓存
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="value">值</param>
        public HTMLCache(string key, string value)
        {
            if (cache[key] == null)
            {
                cache[key] = GetHtml(value);
            }
        }
        /// <summary>
        /// 带Hashtable创建缓存
        /// </summary>
        /// <param name="ht">缓存对象</param>
        public HTMLCache(Hashtable ht)
        {
            foreach (DictionaryEntry de in ht)
            {
                cache[de.Key.ToString()] = GetHtml(de.Value.ToString());
            }
        }
        /// <summary>
        /// 读取方式文本或网页（默认文本）
        /// </summary>
        public bool IoHtml
        {
            get { return ioHtml; }
            set { ioHtml = value; }
        }
        /// <summary>
        /// 缓存保存
        /// </summary>
        public Hashtable Ht
        {
            get { return ht; }
            set { ht = value; }
        }
        /// <summary>
        /// 动态数据缓存
        /// </summary>
        public Hashtable HtPage
        {
            get { return htPage; }
            set { htPage = value; }
        }
        /// <summary>
        /// 缓存对象
        /// </summary>
        public void CachePage()
        {
            foreach (DictionaryEntry de in htPage)
            {//if (cache[de.Key.ToString()] == null) 
                cache[de.Key.ToString()] = de.Value;
            }
        }
        /// <summary>
        /// 缓存所有页面
        /// </summary>
        public void CacheAll()
        {
            foreach (DictionaryEntry de in ht)
            {
                //if (cache[de.Key.ToString()] == null) 
                cache[de.Key.ToString()] = GetHtml(de.Value.ToString());
            }
        }
        /// <summary>
        /// 获取Html模板位置
        /// </summary>
        /// <param name="fileName">文件名称</param>
        /// <returns>内容</returns>
        string GetHtml(string fileName)
        {
            string html = string.Empty;
            string filepath = string.Empty;
            string filemap = ConfigurationManager.AppSettings["HTMLFile"].ToString();
            string webUrl = ConfigurationManager.AppSettings["WebUrl"].ToString();
            if (ioHtml)
            {
                filepath = HttpContext.Current.Request.PhysicalApplicationPath + filemap + "\\" + fileName;
                if (File.Exists(filepath)) html = File.ReadAllText(filepath, System.Text.Encoding.Default);
            }
            else
            {
                filepath = webUrl + filemap + "\\" + fileName;
                html = GetHttpData(filepath);
            }
            return html;
        }
        /// <summary>
        /// 下载url数据
        /// </summary>
        /// <param name="url">地址</param>
        /// <returns>返回字符串</returns>
        private static string GetHttpData(string str)
        {
            WebClient wc = new WebClient();
            try
            {
                str = wc.DownloadString(str);
                return str;
            }
            catch
            {
                return null;
            }
        }
        /// <summary>
        /// 移除所有缓存
        /// </summary>
        public void RemoveAll()
        {
            foreach (DictionaryEntry de in Ht)
            {
                cache.Remove(de.Key.ToString());
            }
        }
        /// <summary>
        /// 移除缓存
        /// </summary>
        /// <param name="CacheName">缓存名</param>
        public void RemoveOnly(string CacheName)
        {
            htPage.Remove(CacheName);
            ht.Remove(CacheName);
            cache.Remove(CacheName);
        }
    }

}
